<extend name="Layout:base"/>

<block name="title">修改比赛</block>
<block name="css">

</block>
<block name="bsgl">active</block>
<block name="cjbs">active</block>
<block name="menu">
    <h5 class="breadcrumbs-title">修改比赛</h5>
    <ol class="breadcrumbs">
        <li class="active"><a href="{:U('Admin/Index/index')}">首页</a>
        </li>
        <li class="active">修改比赛
        </li>
    </ol>
</block>

<block name="main">
    <div class="col s10 m10 l10 offset-l1 offset-s1 offset-m1">
        <h3 class="center-align">修改比赛</h3>
        <form action="" method="post">
            <div class="row">
                <h5>比赛类别：</h5>
                <eq name="ret.enclass" value="0">
                    <div class="col s6 l6 m6 center-align">
                        <input class="with-gap" name="enclass" value="0" type="radio" checked id="class0"/>
                        <label for="class0">团体</label>
                    </div>
                    <div class="col s6 l6 m6 center-align">
                        <input class="with-gap" name="enclass" value="1" type="radio" id="class1"/>
                        <label for="class1">个人</label>
                    </div>
                    <else/>
                    <div class="col s6 l6 m6 center-align">
                        <input class="with-gap" name="enclass" value="0" type="radio" id="class0"/>
                        <label for="class0">团体</label>
                    </div>
                    <div class="col s6 l6 m6 center-align">
                        <input class="with-gap" name="enclass" value="1" type="radio" checked id="class1"/>
                        <label for="class1">个人</label>
                    </div>
                </eq>
            </div>
            <br>
            <div class="row">
                <div class="input-field col s12">
                    <input id="title" name="title" type="text" class="validate" value="{$ret.title}">
                    <label for="title">比赛名称</label>
                </div>
            </div>

            <div class="row">
                <div class="input-field col s12">
                    <select>
                        <option value="{$ret.deptid}" selected>{:getDeptName($ret["deptid"])}</option>
                        <volist name=":getDept()" id="vo">
                            <option value="{$vo.did}">{$vo.name}</option>
                        </volist>

                    </select>
                    <label>负责系部</label>
                </div>
            </div>

            <div class="row">
                <div class="input-field col s12">
                    <input id="pri" name="pri" type="text" value="{$ret.pri}">
                    <label for="pri">负责人</label>
                </div>
            </div>

            <div class="row">
                <div class="input-field col s12">
                    <input id="num" name="num" type="text" value="{$ret.num}">
                    <label for="num">最多报名人数</label>
                </div>
            </div>

            <div class="row">
                <div class="input-field col s12">
                    <input id="start" name="start" type="date" class="datepicker" value="{:date('Y-m-d',$ret[start])}">
                    <label for="start">报名开始时间</label>
                </div>
            </div>

            <div class="row">
                <div class="input-field col s12">
                    <input id="end" name="end" type="date" class="datepicker" value="{:date('Y-m-d',$ret[end])}">
                    <label for="end">报名截止时间</label>
                </div>
            </div>
            <div class="row">
                <eq name="ret.issue" value="1">
                    <h5>比赛发布状态：</h5>
                    <div class="col s6 l6 m6 center-align">
                        <input class="with-gap" name="issue" value="0" type="radio" checked id="issue0"/>
                        <label for="issue0">发布</label>
                    </div>
                    <div class="col s6 l6 m6 center-align">
                        <input class="with-gap" name="issue" value="1" type="radio" id="issue1"/>
                        <label for="issue1">不发布</label>
                    </div>
                    <else/>
                    <div class="col s6 l6 m6 center-align">
                        <input class="with-gap" name="issue" value="0" type="radio" id="issue0"/>
                        <label for="issue0">发布</label>
                    </div>
                    <div class="col s6 l6 m6 center-align">
                        <input class="with-gap" name="issue" value="1" type="radio" checked id="issue1"/>
                        <label for="issue1">不发布</label>
                    </div>
                </eq>
            </div>
            <br>
            <div class="row">
                <h5>内容：</h5>
                <div class="input-field col s12">
                    <script id="editor" name="content" type="text/plain" style="width:100%;height:500px;">
                        {$ret.content}
                    </script>
                </div>
            </div>


            <div class="row">
                <div class="input-field col s12 l12 m12 center-align">
                    <input class="waves-effect waves-light btn blue" name="issue" type="submit" value="发布">
                </div>
            </div>
        </form>
    </div>

</block>

<block name="js">
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/lang/zh-cn/zh-cn.js"></script>


    <script>
        var ue = UE.getEditor('editor');

        $(document).ready(function () {
            $('select').material_select();
            $.extend($.fn.pickadate.defaults, {
                monthsFull: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                monthsShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                weekdaysFull: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
                weekdaysShort: ['日', '一', '二', '三', '四', '五', '六'],
                today: '今天',
                clear: '清除',
                close: '关闭',
                firstDay: 1,
                format: 'yyyy-mm-dd'
            })
            $('.datepicker').pickadate({
                selectMonths: true,
                selectYears: 15,
            });
        });
    </script>
</block>